<template>
  <div id="event">
    <div class="msgLi clearfix" @click="changeState" :class="eventData.isRead ? 'read' : ''">
      <div class="msgInfo hasIntraday">
        <span class="intraday">{{ eventData.createDate }}</span>
        <div class="msgInfoM">
          <i>{{ eventData.time }}</i>
        </div>
      </div>
      <div class="msgTitle">
        <i
          title="标记已读"
          id="i_-7637299521620589828"
          class="msgIgnore vportal vp-ignore"
          style="cursor: pointer"
          onclick="updateMessageState('-7637299521620589828',event)"
        ></i>
        <!-- <img
            src="/seeyon/rest/orgMember/avatar/-7273032013234748168?maxWidth=100&amp;r=1746693318479117"
          /> -->
        <img
          :src="'data:image/jpeg;base64,' + eventData.imageBase64"
          alt="Base64图片"
        />
        <span>{{ eventData.messageContent }}</span>
        <p>{{ eventData.senderName }} {{ eventData.messageCategoryName }}</p>
      </div>
      <div class="msgLine"></div>
      <div class="msgSpot"><span></span></div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    eventData: {
      type: Object,
      default: {
        createDate: "",
        time: "",
        messageContent: "",
        senderName: "",
        messageCategoryName: "",
        imageBase64: "",
      },
    },
  },
  data() {
    return {};
  },
  created() {
    console.log(this.eventData);
  },
  mounted() {},
  methods: {
    // 修改状态
    changeState() {
      if (this.eventData.isRead == false) {
		this.eventData.isRead = true;
        this.axios({
          url: "/seeyon/rest/select/setRead",
          method: "post",
          headers: {
            "Content-Type": "application/json",
            token: localStorage.getItem("restToken"),
          },
          data: {
            loginName: localStorage.getItem("loginName"),
            id: this.eventData.id,
          },
        }).then((res) => {
          console.log("修改状态", res);
        });
		setTimeout(() => {
		    this.$emit('child-event');
		},1000)
      }
    },
  },
};
</script>
<style lang="less" scoped>
.msgLi {
  height: auto;
  padding: 16px 16px 25px;
  /* cursor: pointer; */
  position: relative;
}
.clearfix {
  zoom: 1;
  display: block;
  _height: 1px;
}
.msgLi .msgInfo {
  position: absolute;
  left: 10px;
  top: 0;
  height: 100%;
  width: 110px;
}
.msgLi.read .msgTitle {
  font-weight: normal;
  color: #666;
}
.msgLi .msgLine {
  border-left: 1px dashed #ececec;
  position: absolute;
  left: 126px;
  top: 0;
  width: 1px;
  min-height: 51px;
  height: 100%;
  z-index: 2;
}
.msgLi .msgSpot {
  height: 7px;
  line-height: 7px;
  width: 7px;
  position: absolute;
  left: 123px;
  top: 50%;
  margin-top: -15px;
  z-index: 3;
}
.stadic_right {
  float: right;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 100;
  overflow: hidden;
}
.stadic_content_top {
  margin-left: 218px;
  height: 40px;
}
.stadic_right .stadic_content {
  background-color: #fff;
  margin-left: 218px;
  height: 100%;
  overflow: auto;
}
.stadic_left {
  width: 203px;
  float: left;
  position: absolute;
  height: 100%;
  z-index: 300;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
  background-color: #fff;
}
.msgContent {
  padding: 0 0 0 0;
}

.leftTab li {
  padding-left: 20px;
  line-height: 40px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}
.leftTab li b {
  font-size: 14px;
  padding-right: 10px;
  font-weight: bold;
  color: #c0cbd1;
}
.leftTab li.current {
  background-color: #288def;
  background-color: var(--theme-brand6, #288def);
  color: #fff;
  color: var(--theme-fc-revert, #fff);
}
.leftTab li.current b {
  color: #fff;
  color: var(--theme-fc-revert, #fff);
}
.leftTab li span.text_overflow {
  max-width: 85px;
  display: inline-block;
  vertical-align: top;
}

.personInfo ul {
  padding-left: 30px;
  color: #fff;
}
.personInfo ul li img {
  width: 50px;
  height: 50px;
  border: solid 2px rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  float: left;
}
.personInfo ul li b {
  display: block;
  font-size: 16px;
  line-height: 20px;
  padding-top: 10px;
  padding-left: 65px;
}
.personInfo ul li span {
  display: block;
  font-size: 12px;
  line-height: 20px;
  padding-left: 65px;
}

.personMerger ul li img {
  background-color: none;
  width: 44px;
  height: 44px;
  display: inline-block;
  margin-left: -10px;
}
.msgLi {
  height: auto;
  padding: 16px 16px 25px;
  /*cursor:pointer;*/
  position: relative;
}
.msgIgnore {
  display: none;
  position: absolute;
  right: 10px;
  top: 0;
  color: #111;
  width: 16px;
  height: 14px;
  text-align: center;
  border: 1px solid transparent;
  background-color: #f5f5f5;
}
.msgIgnore:hover {
  border: 1px solid #2490f8;
  broder-color: var(--theme-brand6, #2490f8);
  color: #2490f8;
  color: var(--theme-brand6, #2490f8);
}
.msgLi:hover {
  background-color: #f5f5f5;
}
.msgLi:hover .msgIgnore {
  display: inline-block;
}
.msgLi .msgLine {
  border-left: 1px dashed #ececec;
  position: absolute;
  left: 126px;
  top: 0;
  width: 1px;
  min-height: 51px;
  height: 100%;
  z-index: 2;
}
.msgLi .msgSpot {
  height: 7px;
  line-height: 7px;
  width: 7px;
  position: absolute;
  left: 123px;
  top: 50%;
  margin-top: -15px;
  z-index: 3;
}
.msgLi .msgSpot span {
  background-color: #86bdf5;
  background-color: var(--theme-brand5, #86bdf5);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}

.msgLi .msgInfo {
  position: absolute;
  left: 10px;
  top: 0;
  height: 100%;
  width: 110px;
}
.msgLi .msgInfoM {
  position: absolute;
  right: 0;
  /*top: 50%;*/
  top: 20px;
  width: 60px;
  text-align: center;
}
.msgLi .msgInfo .intraday {
  display: none;
}
.msgLi .msgInfo span {
  display: block;
  color: #535968;
  font-size: 14px;
}
.msgLi .hasIntraday span.intraday {
  position: absolute;
  right: 0;
  top: 5px;
  width: 110px;
  font-size: 14px;
  background-color: #62a9f2;
  background-color: var(--theme-brand5, #62a9f2);
  color: #fff;
  color: var(--theme-fc-revert, #fff);
  display: inline-block;
  padding: 3px 10px;
  width: 110px;
  border-radius: 15px;
  text-align: center;
}
.msgLi .hasIntraday .msgInfoM {
  top: 38px;
}

.msgLi .msgInfo i {
  display: block;
  font-style: normal;
  color: #1f85ec;
  color: var(--theme-brand6, #1f85ec);
  font-size: 12px;
}
.msgLi .msgTitle {
  padding-top: 0;
  /*margin-top: -16px;*/
  padding-left: 170px;
  position: relative;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}
.msgTitle img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  position: absolute;
  left: 130px;
  top: 0;
  display: inline-block;
}
.msgTitle .msgTypeIcon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  position: absolute;
  left: 130px;
  top: 0;
  display: inline-block;
}
.msgTitle .msgTypeIcon .vportal {
  border-radius: 14px;
  overflow: hidden;
  width: 28px;
  height: 28px;
  background: #3ea9f7;
  background: var(--theme-brand5, #3ea9f7);
  display: inline-block;
  line-height: 28px;
  text-align: center;
  font-size: 16px;
  color: #fff;
}
.msgTitle .msgTypeIcon .vportal.vp-aiMsgType0 {
  background-color: #f8903d;
}
.msgLi.read .msgTitle {
  font-weight: normal;
  color: #666;
}
.msgLi .msgTitle p {
  color: #999;
  font-size: 12px;
  font-weight: normal;
}
</style>